package apiday02;

public class ObjectDemo {
    public static void main(String[] args) {
        Point p1 = new Point(100,200);
        Point p2 = new Point(100,200);
        System.out.println(p1 == p2);
        System.out.println(p1.equals(p2));


        StringBuilder builder1 = new StringBuilder("hello");
        StringBuilder builder2 = new StringBuilder("hello");
        //StringBuilder类没有重写equals()，因此调用的还是Object类的equals()比较地址
        System.out.println(builder1.equals(builder2));//f

        String s1 = "hello";
        //s1和builder1的类型不同，所以equals()一定是false
        System.out.println(s1.equals(builder1));//f
    }


}
